<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        <!-- v-show也接受一个布尔值,决定元素是dispaly:none还是block -->
        <button @click="isLogin=true">登录</button>
        <button @click="isLogin=false">注册</button>
        <input type="text" name="username" v-show="isLogin" placeholder="登录">
        <input type="password" name="password" v-show="!isLogin" placeholder="注册">
    </div>
    <script>
        new Vue({
            el:'#app',
            data(){
                return{
                    isLogin:true
                }
            }
        })
    </script>
</body>
</html>